<include file="public@header" />
</head>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('student/index')}">学生列表</a></li>
        <li><a href="{:url('student/add')}">添加学生</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('student/index')}">
        学校名称:
        <select name="school_id" class="form-control" id="selectSchool">
            <option value="0">|--请选择学校--|</option>
            <volist name="school" id='vo'>
                <if $Request.param.school_id==$vo.id>
                    <option value="{$vo.id}" selected>{$vo.name}</option>
                    <else/>
                    <option value="{$vo.id}">{$vo.name}</option>
                </if>
            </volist>
        </select>
        班级名称：
        <select  name="room_id" class="form-control" id="room">
            <option value="">|--请选择班级--|</option>
            <volist name="room" id='vo'>
                <if $Request.param.room_id==$vo.id>
                    <option value="{$vo.id}" selected>{$vo.name}</option>
                    <else/>
                    <option value="{$vo.id}">{$vo.name}</option>
                </if>
            </volist>
        </select>
    <span>学校名称:</span>
        <input type="text" class="form-control" name="name" style="width: 120px;" placeholder="请输入学生"  value="{$Request.param.name}">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('student/index')}" name="">清空</a>
    </form>
    <form  class="margin-top-20">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th width="80" align="center">ID</th>
                <th align="left" width="200px">头像</th>
                <th align="left" width="180px">学生姓名</th>
                <th align="left" width="180px">学生性别</th>
                <th align="left" width="180px">学生年龄</th>
                <th align="left" width="180px">手机号</th>
                <th align="left" width="180px">身份证号</th>
                <th align="left" width="180px">所在班级</th>
                <th align="left" width="180px">所在学校</th>
                <th align="left" width="180px">修改时间</th>
                <th align="left" width="180px">创建时间</th>
                <th align="right">操作</th>
            </tr>
            </thead>
            <tbody>
           <foreach name="student" item="vo">
                <tr>
                    <td>{$key+1}</td>
                    <td>
                        <img  src="__ROOT__/upload/{$vo.image}" width="50">
                    </td>
                    <td>{$vo.name}</td>
                    <td>{$vo.sex}</td>
                    <td>{$vo.age}</td>
                    <td>{$vo.moblie}</td>
                    <td>{$vo.idcard}</td>
                    <td>{$vo.room_name}</td>
                    <td>{$vo.school_name}</td>
                    <td>{$vo.updata_time}</td>
                    <td>{$vo.create_time}</td>
                    <td type="align:right">
                         <a class="btn btn-xs btn-primary " href="{:url('student/edit',array('id'=>$vo['id']))}">编辑</a>
                         <a class="btn btn-xs btn-danger js-ajax-delete" class="" href="{:url('student/delete',array('id'=>$vo['id']))}">删除</a>
                        <a class="btn btn-xs btn-primary " href="{:url('student/chengji',array('id'=>$vo['id']))}">成绩</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
    </form>
    <div class="pagination">
        {$page}
    </div>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script>
    $(function () {
        $('#selectSchool').change('click',function () {
            var schoolId = $('#selectSchool').val();
            $.ajax({
                url: "{:url('student/getRoombySchool')}",
                type: "POST",
                data: {school_id: schoolId},
                success: function (res) {
                    $('#room').html(res);
                    form.render();
                }
            })
        })
    })

</script>
</body>
</html>